package store.lunangangster.engine.impl.repository;

import java.util.List;
import java.util.Map;
import store.lunangangster.engine.bpmn.parser.BpmnParser;
import store.lunangangster.engine.impl.entity.DeploymentEntity;
import store.lunangangster.engine.impl.entity.ProcessDefinitionEntity;
import store.lunangangster.engine.impl.entity.ResourceEntity;
import store.lunangangster.engine.repository.Deployment;

/**
 * 用于表示被解析的{@link Deployment}对象
 *
 * @author cwk
 * @version 1.0
 */
public class DeploymentParse {

  protected DeploymentEntity deployment;
  protected List<ProcessDefinitionEntity> processDefinitionEntities;
  protected Map<ProcessDefinitionEntity, ResourceEntity> processDefinitionToResourceMap ;
  protected Map<ProcessDefinitionEntity, BpmnParser> processDefinitionToBpmnParserMap;

  public DeploymentParse(DeploymentEntity deployment,
      List<ProcessDefinitionEntity> processDefinitionEntities,
      Map<ProcessDefinitionEntity, ResourceEntity> processDefinitionToResourceMap,
      Map<ProcessDefinitionEntity, BpmnParser> processDefinitionToBpmnParserMap) {
    this.deployment = deployment;
    this.processDefinitionEntities = processDefinitionEntities;
    this.processDefinitionToResourceMap = processDefinitionToResourceMap;
    this.processDefinitionToBpmnParserMap = processDefinitionToBpmnParserMap;
  }

  public BpmnParser getBpmnParsersByProcessDefinition(ProcessDefinitionEntity processDefinition) {
    return processDefinitionToBpmnParserMap.get(processDefinition);
  }

  public DeploymentEntity getDeployment() {
    return deployment;
  }

  public List<ProcessDefinitionEntity> getProcessDefinitionEntities() {
    return processDefinitionEntities;
  }

  public Map<ProcessDefinitionEntity, ResourceEntity> getProcessDefinitionToResourceMap() {
    return processDefinitionToResourceMap;
  }

  public Map<ProcessDefinitionEntity, BpmnParser> getProcessDefinitionToBpmnParserMap() {
    return processDefinitionToBpmnParserMap;
  }
}
